﻿using DevExpress.XtraTab;
using System.Windows.Forms;

namespace Mota.XMLControls
{
    /// <summary>
    /// Represent Tab visual control based on DX XtraTabPage
    /// </summary>
    public class DXGuiTab:GuiTab
    {
        /// <summary>
        /// Create XtraTabPage
        /// </summary>
        public DXGuiTab()
        {
            visualControl = new XtraTabPage();
        }
        /// <summary>
        /// Method adds GuiControl object as Child
        /// </summary>
        /// <param name="guiControl">Child Control</param>
        public override void Add(GuiControl guiControl)
        {
            base.Add(guiControl);
            (visualControl as Control).Controls.Add((guiControl.visualControl as Control));
        }
        /// <summary>
        /// SET|GET XtraTabPage Text property
        /// </summary>
        public override string Text
        {
            get
            {
                return (visualControl as XtraTabPage).Text;
            }
            set
            {
                (visualControl as XtraTabPage).Text = value;
            }
        }
        /// <summary>
        /// Dummy object and setter allways return null value
        /// </summary>
        public override object Binding
        {
            get
            {
                return null;
            }
            set
            {
            }
        }

        public override void SetValue(object valueBinding)
        {
            throw new System.NotImplementedException();
        }

        public override object GetValue()
        {
            throw new System.NotImplementedException("Tab dont have value");
        }
    }
}
